{wc:templates "index","header"}
<script>
function showh(){
var height=$("#ddBrandList").innerHeight();	
	if(height==78){
		$("#ddBrandList").css("height","auto");
		$(".list_classMore").addClass("MoreClick");
		$(".list_classMore").html("收起<i></i>");
	}else{
		$("#ddBrandList").css("height",78);
		$(".list_classMore").removeClass("MoreClick");
		$(".list_classMore").html("展开<i></i>");
	};
}

$("#m_all_sort").hide();
$(function(){	
	$(".list_classMore").click(showh);
});

$(".m_menu_all").mouseenter(function(){
$(".m_all_sort").show();
     })
$(".m_menu_all").mouseleave(function(){
$(".m_all_sort").hide();
     })
$(".m_all_sort").mouseenter(function(){
$(this).show();
     })
$(".m_all_sort").mouseleave(function(){
  $(this).hide();
})

$(function(){
  $(window).scroll(function() {	
 		
		if($(window).scrollTop()>=130&&$(window).scrollTop()<=560){
			$(".head_nav").addClass("fixedNav");	
			$("#m_all_sort").fadeOut();
		}else if($(window).scrollTop()>560){
			$(".head_nav").addClass("fixedNav");
			$("#m_all_sort").fadeOut();
	} else if($(window).scrollTop()<130){
			$(".head_nav").removeClass("fixedNav");
	}
      });
});

// $("#_click").find('li').eq(0).addClass('bg_red');

</script>
<div class="wrap w1200" id="loadingPicBlock">
	<div class="Current_nav w1200"><a href="{WEB_PATH}">首页</a> &gt; {wc:$daohang_title}</div>
	<div id="current" class="list_Curtit b_gray">
		<h1 class="fl c_red">{wc:$daohang_title}</h1> 
		<span id="spTotalCount">(共<em class="c_red">{wc:$total}</em>件相关商品)</span>
	</div>
	<div class="list_class">
	<dl>
		<dt>分类</dt>
		<dd>
		<ul id="_click">
		{wc:if !$fen1}            
			<li><a href="{WEB_PATH}/goods_list/0" class="ClassCur">全部</a></li>
		{wc:else}
			<li><a href="{WEB_PATH}/goods_list/0">全部</a></li>
		{wc:if:end}
               		{wc:getlist sql="select * from `@#_category` where `model`='1' and `parentid` = '0' order by `order` DESC"}
               		{wc:loop $data $categoryx}

               		{wc:if $categoryx['cateid']==$fen1}
			<li><a  class="ClassCur" href="{WEB_PATH}/goods_list/{wc:$categoryx['cateid']}">{wc:$categoryx['name']}</a></li>
			{wc:else}
			<li><a  href="{WEB_PATH}/goods_list/{wc:$categoryx['cateid']}">{wc:$categoryx['name']}</a></li>
			{wc:if:end}
			{wc:loop:end}

			{wc:getlist:end}
		</ul>
		</dd>
	</dl>
	</div>	
	<div class="list_class">
	<dl>
		<dt>品牌</dt>
		{wc:if count($brand)>17}
		<dd id="ddBrandList" style="height:78px">
		{wc:else}
		<dd id="ddBrandList">
		{wc:if:end}
			<ul>
            	{wc:if !$fen2}
				<li><a href="{WEB_PATH}/goods_list" class="ClassCur" >全部</a></li>
                {wc:else}
                <li><a href="{WEB_PATH}/goods_list">全部</a></li>
                {wc:if:end}
				{wc:loop $brand $brand2}
                {wc:if $brand2['id']==$fen2}
				<li><a class="ClassCur"  href="{WEB_PATH}/goods_list/{wc:$brand2['cateid']}e{wc:$brand2['id']}" title="{wc:$brand2['name']}">{wc:$brand2['name']}</a></li>
                {wc:else}
                <li><a  href="{WEB_PATH}/goods_list/{wc:$brand2['cateid']}e{wc:$brand2['id']}" title="{wc:$brand2['name']}">{wc:$brand2['name']}</a></li>
                 {wc:if:end}
				{wc:loop:end}
			</ul>
		</dd>
	</dl>

	{wc:if count($brand)>17}	
	<a class="list_classMore" href="javascript:;">展开<i></i></a>
	{wc:if:end}	
	</div>
	 <div class="list_Sort">
		    <dl>
			    <dt>排序</dt>
			    <dd>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/10" {wc:if $select=='10'}class="SortCur"{wc:if:end}>即将揭晓</a>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/20" {wc:if $select=='20'}class="SortCur"{wc:if:end}>人气</a>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/30" {wc:if $select=='30'}class="SortCur"{wc:if:end}>剩余人次</a>
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/40" {wc:if $select=='40'}class="SortCur"{wc:if:end}>最新</a>
                {wc:if $select=='50'}
                <a href="{WEB_PATH}/goods_list/{wc:$cate_band}/60" class="Price_Sort SortCur">价格 <i></i></a>
                {wc:else}
                    {wc:if $select=='60'}
                   		<a href="{WEB_PATH}/goods_list/{wc:$cate_band}/50" class="Price_Sort SortCur">价格 <s></s></a>
                    {wc:else}
                    	<a href="{WEB_PATH}/goods_list/{wc:$cate_band}/50" class="Price_Sort">价格 <s></s></a>
                    {wc:if:end}
                {wc:if:end}
                </dd>
		    </dl>
	    </div>
	<div class="get_ready w1200">
	<ul>		
		{wc:loop $shoplist $shop}
		<li class="list-block">
			<div class="pic">
				<a href="{WEB_PATH}/goods/{wc:$shop['id']}" target="_blank" title="{wc:$shop['title']} ">
					{wc:if isset($shop['t_new_goods'])}						
					<i class="goods_xp"></i>					
					{wc:if:end}					
					{wc:if isset($shop['t_max_qishu'])}							
					<i class="goods_rq"></i>							
					{wc:if:end}
					{wc:if $shop['pos']!='0'}
					<i class="goods_tj"></i>
					{wc:if:end}
					<img alt="{wc:$shop['title']}" src="{G_UPLOAD_PATH}/{wc:$shop['thumb']}">
				</a>
				<p name="buyCount" style="display:none;"></p>
			</div>
			<p class="name">
				<a href="{WEB_PATH}/goods/{wc:$shop['id']}" target="_blank" title="{wc:$shop['title']} ">{wc:$shop['title']}</a>
			</p>
			<p class="money">价值：<span class="rmb">{wc:$shop['money']}</span></p>
			<div class="Progress-bar">
				<p title="已完成{wc:fun:percent($shop['canyurenshu'],$shop['zongrenshu'])}"><span style="width:{wc:fun:percent($shop['canyurenshu'],$shop['zongrenshu'])};"></span></p>
				<ul class="Pro-bar-li">
					<li class="P-bar01"><em>{wc:$shop['canyurenshu']}</em>已参与人次</li>
					<li class="P-bar02"><em>{wc:$shop['zongrenshu']}</em>总需人次</li>
					<li class="P-bar03"><em>{wc:$shop['zongrenshu']-$shop['canyurenshu']}</em>剩余人次</li>
				</ul>
			</div>
			<div class="w-goods-ing">
				<div class="shop_buttom bg_red b_red1" style="margin:0 10px;width:115px;height:30px;">
					<a href="javascript:;" style="line-height:30px;font-size:14px;" class="Det_Shopnow" onclick="jwebox.goshopnow({wc:$shop['id']},'{WEB_PATH}')">立即夺宝</a>
				</div>
				<div class="shop_buttom1 bg_pink b_pink c_red" style="margin:0px 10px;width:115px;height:30px;">
					<a href="javascript:;" onclick="gcartlist.gocartlist({wc:$shop['id']},'{WEB_PATH}','wc_')" class="c_red" style="line-height:30px;font-size:14px;" id="car_{wc:$shop['id']}">加入购物车</a>
				</div>
			</div>
			<div class="fail" style="display:none">
			    <div class="main" style="text-indent:4em">购物车已存在！加入失败</div>
			    <div class="arrow"><em>◆</em><s>◆</s></div>
			</div>
			<div class="success" style="display:none">
				<div class="main" style="text-indent:4em">恭喜您,加入购物车成功</div>
			    <div class="arrow"><em>◆</em><s>◆</s></div>
			</div>	
		</li>
		{wc:loop:end}
	</ul>
	{wc:if $total>$num}
	<div style="height: 80px;  width: 1200px; float: left;">
		<div class="pagesx">{wc:page:two}</div>
	</div>
	
	{wc:if:end}
	</div>	  
</div>
<script type="text/javascript">

$(function(){
	$("#ulGoodsList li a.go_cart").click(function(){ 
		var sw = $("#ulGoodsList li a.go_cart").index(this);
		var src = $("#ulGoodsList li .pic a img").eq(sw).attr('src');				
		var $shadow = $('<img id="cart_dh" style="display:none; border:1px solid #aaa; z-index:99999;" width="200" height="200" src="'+src+'" />').prependTo("body");  			
		var $img = $("#ulGoodsList li .pic").eq(sw);
		$shadow.css({ 
			'width' : 200, 
			'height': 200, 
			'position' : 'absolute',      
			"left":$img.offset().left+16, 
			"top":$img.offset().top+9,
			'opacity' : 1    
		}).show();
		var $cart = $("#btnMyCart");
		$shadow.animate({   
			width: 1, 
			height: 1, 
			top: $cart.offset().top,    
			left: $cart.offset().left, 
			opacity: 0
		},500,function(){
			Cartcookie(sw,false);
		});	
		
	});
	$("#ulGoodsList li a.go_Shopping").click(function(){	
		var sw = $("#ulGoodsList li a.go_Shopping").index(this);

		Cartcookie(sw,true); 
	});	
});
//存到COOKIE
function Cartcookie(sw,cook){
	var shopid = $(".Curbor_id").eq(sw).text(),
		shenyu = $(".Curbor_yunjiage").eq(sw).text(),
		money = $(".Curbor_shenyu").eq(sw).text();
	var Cartlist = $.cookie('Cartlist');
	if(!Cartlist){
		var info = {};
	}else{
		var info = $.evalJSON(Cartlist);
	}
	if(!info[shopid]){
		var CartTotal=$("#sCartTotal").text();
			$("#sCartTotal").text(parseInt(CartTotal)+1);
			$("#btnMyCart em").text(parseInt(CartTotal)+1);
	}	
	info[shopid]={};
	info[shopid]['num']=1;
	info[shopid]['shenyu']=shenyu;
	info[shopid]['money']=money;
	info['MoenyCount']='0.00';
	$.cookie('Cartlist',$.toJSON(info),{expires:30,path:'/'});
	if(cook){
		window.location.href="{WEB_PATH}/member/cart/cartlist";
	}
}  

</script>
{wc:templates "index","footer"}